package com.marketingcenter.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.util.List;

/**
 * 满减满赠满返活动实体类
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "threshold_promotion")
public class ThresholdPromotion extends Promotion {

    private static final long serialVersionUID = 1L;

    /**
     * 活动类型：1-满减，2-满赠，3-满返
     */
    private Integer thresholdType;

    /**
     * 活动规则列表
     */
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JoinColumn(name = "promotionId")
    private List<ThresholdRule> rules;

    /**
     * 使用范围：1-全场通用，2-指定商品，3-指定分类
     */
    private Integer useScope;

    /**
     * 适用商品/分类ID列表，JSON格式存储
     */
    private String applicableIds;

    /**
     * 是否可与其他优惠叠加
     */
    private Boolean canStack;

}